package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/api/apis"
	"tuowei.com/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, registerSysRegionRouter)
	routerNoCheckRole = append(routerNoCheckRole, registerNoCheckSysRegionRouter)
}

// 需认证的路由代码
func registerSysRegionRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.SysRegion{}
	r := v1.Group("/region").Use(authMiddleware.MiddlewareFunc()).Use(middleware.CheckLogin)
	{
		r.GET("/province/list", api.GetTree)
	}

}

func registerNoCheckSysRegionRouter(v1 *gin.RouterGroup) {
	api := apis.SysRegion{}
	r := v1.Group("/region")
	{
		r.GET("/getProvinceByCity", api.GetProvinceByCity)
	}

}
